package scau.cty.web;

import org.apache.shiro.SecurityUtils;
import org.springframework.web.bind.annotation.*;
import scau.cty.base.common.BaseController;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * Created by cty on 2016/12/4.
 */
@ApiIgnore
@RestController
@RequestMapping(value = "test", produces = "application/json")
public class TestController extends BaseController {

    @GetMapping("/1")
    public String testAuthc() {
        return "test";
    }

    @GetMapping("get_username")
    public String getUsername() {
        String username= (String) SecurityUtils.getSubject().getPrincipal();
        return username;
    }
}

